<?php

namespace App\Http\Requests;

class ForgetRequest extends FormRequest
{
    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'phone_key' => ['required','string'],
            'phone_code' => ['required','string','phone'],
        ];
    }

    public function messages()
    {
        return [
            'phone_key.required'=>['error_code'=>'F002005','message'=>'手机验证码 key 不能为空！'],
            'phone_key.string'=>['error_code'=>'F002006','message'=>'手机验证码 key 必须是字符串！'],
            'phone_code.required'=>['error_code'=>'F002007','message'=>'手机验证码不能为空！'],
            'phone_code.string'=>['error_code'=>'F002008','message'=>'手机验证码必须是字符串！'],
            'phone_code.phone'=>['error_code'=>'F002009','message'=>'手机验证码错误！'],
        ];
    }
}
